<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //一般用于异步网络请求
        // function a(callback){
        //     callback();
        //     console.log('1');
        // }
        // function b(){
        //     setTimeout(function(){
        //         console.log('2');
        //     },2000)
            
        // }
        // a(b);
        //模拟网络请求
        function aa(callback){
            setTimeout(function(){
                console.log('111');
                callback('222');
            },1000)
        }
        aa(function(b){
            console.log(b);
        })
    </script>
</body>
</html>